/* Janus Chat - Version 1.0
 * Authors: Matthew Perry
 *          Michael Freid
 *          Marc Latou
 *          Richard Lee
 *
 * The Janus Chat Client is a highly secured
 * peer-to-peer chat client designed to facilitate
 * the transfer of sensitive data or as a communication
 * medium for the extra paranoid
 *
 * This file contains the header for a wrapper
 * of the crypto++ RSA library so that Janus can encrypt
 * its session keys for AES message encryption */

#ifndef JAES_H
#define JAES_H

#include <string>

class jAes
{
    private:
        struct sessionKey {
            unsigned char* key;
            unsigned int keyLen;
            unsigned char* iv;
            unsigned int ivLen;
        };
        static std::string serialize( struct sessionKey* key );
        static struct sessionKey recover( const std::string& sKey );

    public:
        static std::string generateKey( int size );

        static std::string encrypt( const std::string& sKey, const std::string& plaintext );
        static std::string decrypt( const std::string& sKey, const std::string& cipher );
};

#endif //JAES_H

